package com.server.questionbank.snframe.controller.QuestionBan;

import com.server.questionbank.snframe.domain.Course.TCourse;
import com.server.questionbank.snframe.domain.ResDTO.ResponseResult;
import com.server.questionbank.snframe.service.QuestionBank.Impl.CoursesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/questionban")
public class CoursesController {
    @Autowired
    private CoursesServiceImpl coursesService;

    @GetMapping("/courses")
    public ResponseResult<List<TCourse>> getAllCourses() {
        List<TCourse> courses = coursesService.getCourse();
        return ResponseResult.success(courses);
    }
}
